import java.util.*;
import java.math.*;

public class euler018 {
    
	static public final int MAX_ITEMS = 1000;

    static public void main(String[] params) {
        Scanner scan = new Scanner(System.in);
		int a[] = new int[MAX_ITEMS];        
		int l;
        int r = 0;
        int t1 = 0;
        int t2;
		
        while (scan.hasNextInt()) {
            n = scan.nextInt();
			if (r > l) {
				r = 0;
				l++;
				t1 = 0;
			}
			t2 = a[r];
			a[r] = n + Math.max (a[r], t1);
			t1 = t2;
			r++;
        }
        
        for (int i = 0; i < l; i++) {
			System.out.print(a[i] + " ");
        }
		
		System.out.println();
    }
}

